<!--
/**
 * 主机 列表页 JS 脚本
 * @author 金杰 , maillank@qq.com
 * @since 2021-11-20 16:56:52
 */
 -->
 <!DOCTYPE html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8"/>
    <title th:text="${lang.translate('主机')}">主机</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/assets/libs/layui/css/layui.css" th:href="'/assets/libs/layui/css/layui.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="/assets/css/admin.css" th:href="'/assets/css/admin.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="/assets/libs/toast/css/toast.css" type="text/css" th:href="'/assets/libs/toast/css/toast.css?'+${cacheKey}">
    <link rel="stylesheet" href="/assets/css/foxnic-web.css" th:href="'/assets/css/foxnic-web.css?'+${cacheKey}">
    <link href="/assets/libs/font-awesome-4.7.0/css/font-awesome.min.css" th:href="@{/assets/libs/font-awesome-4.7.0/css/font-awesome.min.css}" rel="stylesheet"/>
    <script th:inline="javascript">var foxnic_cachekey=[[${cacheKey}]];</script>    <link th:if(theme.ico!="null") rel="shortcut icon" th:href="${theme.ico}" type="image/vnd.microsoft.icon"> <link th:if(theme.ico!="null") rel="icon" th:href="theme.ico" type="image/vnd.microsoft.icon">
    <link th:each="css:${theme.css}" rel="stylesheet" th:href="${css}+'?'+${cacheKey}">
    <style>
    </style>
</head>

<body style="overflow-y: hidden">

<div class="layui-card">

    <div class="layui-card-body" style="">

        <div class="search-bar" style="">

            <div class="search-input-rows" style="opacity: 0">
                <!-- 搜索输入区域 -->
                <div class="layui-form toolbar search-inputs">
                    <!-- 主键 , id ,typeName=text_input, isHideInSearch=true -->
                    <!-- 主机类型 , hostType ,typeName=select_box, isHideInSearch=true -->
                    <!-- 主机状态 , status ,typeName=radio_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('主机状态')}" class="search-label status-label">主机状态</span><span class="search-colon">:</span></div>

                        <div id="status" th:data="${enum.toArray('com.dt.platform.constants.enums.ops.HostStatusEnum')}" style="width:150px"></div>

                    </div>
                    <!-- 监控状态 , monitorStatus ,typeName=radio_box, isHideInSearch=true -->
                    <!-- 负责人 , directorUsername ,typeName=text_input, isHideInSearch=true -->
                    <!-- 内存 , hostMemory ,typeName=number_input, isHideInSearch=true -->
                    <!-- CPU , hostCpu ,typeName=number_input, isHideInSearch=true -->
                    <!-- 其他配置 , hostConf ,typeName=text_input, isHideInSearch=true -->
                    <!-- 系统管理员 , userOsAdmin ,typeName=text_input, isHideInSearch=true -->
                    <!-- 数据库管理员 , userDbAdmin ,typeName=text_input, isHideInSearch=true -->
                    <!-- 数据库使用用户 , userDbUsed ,typeName=text_input, isHideInSearch=true -->
                    <!-- 应用使用用户 , userAppUsed ,typeName=text_input, isHideInSearch=true -->
                    <!-- 运维操作用户 , userOpsOper ,typeName=text_input, isHideInSearch=true -->
                    <!-- 其他用户 , userOther ,typeName=text_area, isHideInSearch=true -->
                    <!-- 改密策略 , passwordStrategyId ,typeName=select_box, isHideInSearch=true -->
                    <!-- 备份方式 , hostBackupMethod ,typeName=select_box, isHideInSearch=true -->
                    <!-- 备份情况 , hostBackupInfo ,typeName=text_input, isHideInSearch=true -->
                    <!-- 下线时间 , offlineTime ,typeName=date_input, isHideInSearch=true -->
                    <!-- 上线时间 , onlineTime ,typeName=date_input, isHideInSearch=true -->
                    <!-- 是否归档 , arch ,typeName=text_input, isHideInSearch=true -->
                    <!-- 用户凭证 , voucherIds ,typeName=select_box, isHideInSearch=true -->
                    <!-- 信息系统 , systemId ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('信息系统')}" class="search-label systemId-label">信息系统</span><span class="search-colon">:</span></div>
                        <div id="systemId" th:data="${'/service-ops/ops-information-system/query-list'}" style="width:150px" extraParam="{}"></div>
                    </div>
                    <!-- 虚拟VIP , hostVip ,typeName=text_input, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('虚拟VIP')}" class="search-label hostVip-label">虚拟VIP</span><span class="search-colon">:</span></div>
                        <input id="hostVip" class="layui-input search-input" style="width: 150px" type="text" />
                    </div>
                    <!-- 物理IP , hostIp ,typeName=text_input, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('物理IP')}" class="search-label hostIp-label">物理IP</span><span class="search-colon">:</span></div>
                        <input id="hostIp" class="layui-input search-input" style="width: 150px" type="text" />
                    </div>


                </div>
                <!-- 搜索输入区域 -->
                <div class="layui-form toolbar search-inputs">
                    <!-- 名称 , hostName ,typeName=text_input, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('名称')}" class="search-label hostName-label">名称</span><span class="search-colon">:</span></div>
                        <input id="hostName" class="layui-input search-input" style="width: 150px" type="text" />
                    </div>
                    <!-- 操作系统 , hostOsIds ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('操作系统')}" class="search-label hostOsIds-label">操作系统</span><span class="search-colon">:</span></div>
                        <div id="hostOsIds" th:data="${'/service-ops/ops-service-info/query-list?groupId=os'}" style="width:150px" extraParam="{}"></div>
                    </div>
                    <!-- 数据库 , hostDbIds ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('数据库')}" class="search-label hostDbIds-label">数据库</span><span class="search-colon">:</span></div>
                        <div id="hostDbIds" th:data="${'/service-ops/ops-service-info/query-list?groupId=db'}" style="width:150px" extraParam="{}"></div>
                    </div>
                    <!-- 中间件 , hostMiddlewareIds ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('中间件')}" class="search-label hostMiddlewareIds-label">中间件</span><span class="search-colon">:</span></div>
                        <div id="hostMiddlewareIds" th:data="${'/service-ops/ops-service-info/query-list?groupId=mid'}" style="width:150px" extraParam="{}"></div>
                    </div>


                </div>
                <!-- 搜索输入区域 -->
                <div class="layui-form toolbar search-inputs">
                    <!-- 所在位置 , positionId ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('所在位置')}" class="search-label positionId-label">所在位置</span><span class="search-colon">:</span></div>
                        <div id="positionId" th:data="${'/service-ops/ops-host-position/query-list'}" style="width:150px" extraParam="{}"></div>
                    </div>
                    <!-- 所在环境 , environment ,typeName=select_box, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('所在环境')}" class="search-label environment-label">所在环境</span><span class="search-colon">:</span></div>
                        <div id="environment" th:data="${dict.toArray('ops_environment')}" style="width:150px" extraParam="{}"></div>
                    </div>
                    <!-- 标签 , labels ,typeName=text_input, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('标签')}" class="search-label labels-label">标签</span><span class="search-colon">:</span></div>
                        <input id="labels" class="layui-input search-input" style="width: 150px" type="text" />
                    </div>
                    <!-- 备注 , hostNotes ,typeName=text_area, isHideInSearch=false -->
                    <div class="search-unit">
                        <div class="search-label-div" style="width:70px"><span th:text="${lang.translate('备注')}" class="search-label hostNotes-label">备注</span><span class="search-colon">:</span></div>
                        <input id="hostNotes" class="layui-input search-input" style="width: 150px" type="text" />
                    </div>


                </div>
            </div>


            <!-- 按钮区域 -->
            <div class="layui-form toolbar search-buttons" style="opacity: 0">
                <button id="search-button" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>&nbsp;&nbsp;<span th:text="${lang.translate('搜索')}">搜索</span></button>
                <button id="search-button-advance" class="layui-btn layui-btn-primary icon-btn search-button-advance"><i class="layui-icon">&#xe671;</i><span th:text="${lang.translate('更多')}">更多</span></button>
            </div>
        </div>

        <div style="margin-top: 84px ">
            <table class="layui-table" id="data-table" lay-filter="data-table"></table>
        </div>

    </div>
</div>

<script type="text/javascript" src="/module/global.js" th:src="'/module/global.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/jquery-3.2.1.min.js" th:src="'/assets/libs/jquery-3.2.1.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/pandyle.min.js" th:src="'/assets/libs/pandyle.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/layui/layui.js" th:src="'/assets/libs/layui/layui.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/toast/js/toast.js" th:src="'/assets/libs/toast/js/toast.js?'+${cacheKey}"></script>

<!-- 表格工具栏 -->
<script type="text/html" id="toolbarTemplate">
    <div class="layui-btn-container">
        <button th:if="${perm.checkAuth('ops_host:create')}" id="add-button" class="layui-btn icon-btn layui-btn-sm create-new-button " lay-event="create"><i class="layui-icon">&#xe654;</i><span th:text="${lang.translate('新建')}">新建</span></button>
        <button th:if="${perm.checkAuth('ops_host:delete-by-ids')}" id="delete-button" class="layui-btn icon-btn layui-btn-danger layui-btn-sm batch-delete-button " lay-event="batch-del"><i class="layui-icon">&#xe67e;</i><span th:text="${lang.translate('删除')}">删除</span></button>
        <button id="export-host"  th:if="${perm.checkAuth('ops_host:export')}"class="layui-btn icon-btn layui-btn-sm " lay-event="tool-export-host"><span th:text="${lang.translate('数据导出')}">数据导出</span></button>
    </div>
</script>

<!-- 表格操作列 -->
<script type="text/html" id="tableOperationTemplate">

    <button th:if="${perm.checkAuth('ops_host:view-form')}" class="layui-btn layui-btn-primary layui-btn-xs ops-view-button " lay-event="view" th:text="${lang.translate('查看')}" data-id="{{d.id}}">查看</button>
    <button th:if="${perm.checkAnyAuth('ops_host:update','ops_host:save')}" class="layui-btn layui-btn-primary layui-btn-xs ops-edit-button " lay-event="edit" th:text="${lang.translate('修改')}" data-id="{{d.id}}">修改</button>


    <button th:if="${perm.checkAuth('ops_host:delete')}" class="layui-btn layui-btn-xs layui-btn-danger ops-delete-button " lay-event="del" th:text="${lang.translate('删除')}" data-id="{{d.id}}">删除</button>

    <button class="layui-btn layui-btn-xs  ops_host:voucher " lay-event="open-host-voucher-window" th:text="${lang.translate('凭证')}" data-id="{{d.id}}">凭证</button>

</script>


<script th:inline="javascript">
    var LAYUI_TABLE_WIDTH_CONFIG = [[${pageHelper.getTableColumnWidthConfig('data-table')}]];
    var SELECT_HOSTTYPE_DATA = [[${dict.toArray('ops_host_type')}]];
    var RADIO_STATUS_DATA = [[${enum.toArray('com.dt.platform.constants.enums.ops.HostStatusEnum')}]];
    var SELECT_ENVIRONMENT_DATA = [[${dict.toArray('ops_environment')}]];
    var RADIO_MONITORSTATUS_DATA = [[${enum.toArray('com.dt.platform.constants.enums.ops.HostMonitorStatusEnum')}]];
    var SELECT_PASSWORDSTRATEGYID_DATA = [[${dict.toArray('ops_host_password_strategy')}]];
    var AUTH_PREFIX="ops_host";


</script>

<script th:src="'/business/ops/host/host_ext.js?'+${cacheKey}"></script>
<script th:src="'/business/ops/host/host_list.js?'+${cacheKey}"></script>

</body>
</html>